package com.cssl.util;

public class Result {
    //返回执行是否成功代码
    Integer code;
    //放回执行结果消息
    String msg;
    //返回数据
    Object data;
    //返回时间戳
    Long timeStamp;

    public Result() {
    }

    public Result(Integer code, String msg, Object data, Long timeStamp) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.timeStamp = timeStamp;
    }
    public Result(Integer code, String msg, Long timeStamp) {
        this.code = code;
        this.msg = msg;
        this.timeStamp = timeStamp;
    }

    public static Result result(Integer code, String msg, Object data, Long timeStamp) {
        return new Result(code,msg,data,timeStamp);
    }

    public static Result fail(Integer code, String msg, Long timeStamp) {
        return new Result(code,msg,timeStamp);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Long getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Long timeStamp) {
        this.timeStamp = timeStamp;
    }
}
